home *** CD-ROM | disk | FTP | other *** search
- Path: inforamp.net!usenet
- From: pitchl@tdbank.ca (Lew Pitcher)
- Newsgroups: comp.lang.c
- Subject: Re: Do you have ever pass structures?
- Date: Tue, 27 Feb 1996 01:16:52 GMT
- Organization: Toronto Dominion Bank
- Message-ID: <4gtm62$gjb@sam.inforamp.net>
- References: <4ge8mi$qjm@srvr1.engin.umich.edu> <4ggsio$343@news-f.iadfw.net> <4gqk11$e7l@airdmhor.gen.nz>
- NNTP-Posting-Host: ts29-12.tor.inforamp.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- gumboot@airdmhor.gen.nz (Simon Hosie) wrote:
-
- >Adam Peterson:
- >> The *disadvantage* is speed and space. Passing a pointer is just
- >> word//double word. Passing the actual structure requires loading the
- >> stack with all the elements of the structure...slow...
-
- > But once it's done you don't have this pointer-thing to dereference all
- >the time (of course, this depends on how much register space you have - will
- >I ever get over my Intelesque hangups?).
-
- Yah, but you still wind up dereferencing a pointer (just this time
- it's the stack pointer). If you really want efficiency, then define a
- global structure variable, put your data into it, and let the called
- function access it directly. There should be less pointer
- dereferencing that way.
-
-
- Lew Pitcher | "I'm a little source code
- Toronto Dominion Bank | Short and Stout
- ======================= | Here is my Input,
- Enzo Matrix - Reboot | And here is my out"
-
-